if exists (select 1 from sysobjects where name = 'set_mandant' and type = 'P')
begin
   drop procedure set_mandant
   print 'Procedure: set_mandant deleted ...'
end
go
create procedure set_mandant(
  @mandid            char(2)        = 'PA',
  @name              varchar(35)    = 'Personalplaner mandant',
  @beschreibung      varchar(250)   = 'Default mandant',
  @retval            int            = 0 output
)
as
begin
  set nocount on
--test
  insert into mandant 
              (mandid,
               name,
               beschreibung)
       values (@mandid,
               @name,
               isnull(@beschreibung,''))

end
go
print 'Procedure: set_mandant done ...'
go
grant exec on set_mandant to prsadmins with grant option
go
grant exec on set_mandant to prsusers
go

